var departmentList;
$(function () {
    if($('#departmentList').length>0){
        departmentList = $.fn.bsgrid.init('departmentList', {
            url:'../../doAdminAction.php?act=departmentList',               //数据地址
            // autoLoad: false,
            pageSizeSelect: true,
            pageSize: 10,
            stripeRows: true,
            displayBlankRows:false
        });
    }
});
//department表格相关方法
var department={
    //表格操作
    operate:function(record, rowIndex, colIndex, options){
        var id=departmentList.getRecordIndexValue(record, 'id')
        var operate='';
        operate+='<a href="departmentEdit.php?id=' + id + '">编辑</a> <a href="javascript:;" onclick="department.del(' + id + ')">删除</a>';
        return operate;
    },
    //删除选中部门
    del:function(id){
        table.del({
            "id":id,
            "url":'../../doAdminAction.php?act=departmentDel'
        })
    }
}
